<?php

use yii\helpers\Html;
use yii\helpers\Url;
use kartik\grid\GridView;

/**
 * @var yii\web\View $this
 * @var yii\data\ActiveDataProvider $dataProvider
 * @var yiike\core\models\search\NoticeSearch $searchModel
 */
$this->title                   = $searchModel->getAliasModel(true);
$this->params['bis_readcrumbs'][] = $this->title;
?>

<div class="giiant-crud notice-index">

    <?php //      echo $this->render('_search', ['model' =>$searchModel]);   ?>


    <?php \yii\widgets\Pjax::begin(['id' => 'pjax-main', 'enableReplaceState' => false, 'linkSelector' => '#pjax-main ul.pagination a, th a', 'clientOptions' => ['pjax:success' => 'function(){alert("yo")}']]) ?>

    <div class="box box-info">
        <div class="box-header with-border">
            <h3 class="box-title"><span class="fa fa-list"></span>列表</h3>
            <div class="box-tools pull-right">
                <?= Html::a('<span class="fa fa-plus"></span> 新增', ['create'], ['class' => 'btn btn-success btn-sm']) ?>


                <?=
                \yii\bootstrap\ButtonDropdown::widget(
                        [
                            'id'          => 'giiant-relations',
                            'encodeLabel' => false,
                            'label'       => '<span class="fa fa-paperclip"></span> 关联',
                            'dropdown'    => [
                                'options'      => [
                                    'class' => 'dropdown-menu-right'
                                ],
                                'encodeLabels' => false,
                                'items'        => []
                            ],
                            'options'     => [
                                'class' => 'btn-default btn-sm'
                            ]
                        ]
                );
                ?>                
            </div>
        </div>

        <div class="box-body">


            <div class="table-responsive">
                <?=
                GridView::widget([
                    'layout'           => '{summary}{pager}{items}{pager}',
                    'dataProvider'     => $dataProvider,
                    'pager'            => [
                        'class'          => yii\widgets\LinkPager::className(),
                        'firstPageLabel' => 'First',
                        'lastPageLabel'  => 'Last'],
                    'filterModel'      => $searchModel,
                    'tableOptions'     => ['class' => 'table table-striped table-bordered table-hover'],
                    'headerRowOptions' => ['class' => 'x'],
                    'columns'          => [
                        [
                            'class'          => 'yii\grid\ActionColumn',
                            'template'       => '{update} {delete}',
                            'buttonOptions'  => ['class' => 'btn btn-default btn-xs'],
                            'contentOptions' => ['nowrap' => 'nowrap']
                        ],
                        'user_id',
                        [
                            'attribute' => 'title_icon',
                            'format' => 'raw',
                            'value' => function ($model) {
                                return $model->titleIcon;
                            },
                        ],
                        'title',
                        [
                            'attribute' => 'status',
                            'class' => 'kartik\grid\BooleanColumn'
                        ],       
                        'created_at:date',
                    ],
                ]);
                ?>
            </div>
        </div>
    </div>
</div>


<?php \yii\widgets\Pjax::end() ?>



